package com.chisheng.caa.pojo;

import com.chisheng.caa.pojo.dto.GradeDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;

@ApiModel("抽象设定信息类")
public abstract class AbstractSetting implements Setting {

    @ApiModelProperty("冲突处理策略")
    protected DuplicateStrategy duplicateStrategy;

    @Valid
    @ApiModelProperty("年级信息")
    protected GradeDTO grade;

    public AbstractSetting() {
    }

    public AbstractSetting(Setting setting) {
        grade = setting.getGrade();
        duplicateStrategy = setting.getDuplicateStrategy();
    }

    @Override
    public DuplicateStrategy getDuplicateStrategy() {
        return duplicateStrategy;
    }

    @Override
    public GradeDTO getGrade() {
        return grade;
    }

}
